﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

using Skyhook.Core;
using Skyhook.Core.Screens;
using Skyhook.Core.Graphics;
using Skyhook.Core.Input;
using Skyhook.Core.Configuration;
using Skyhook.Resources;
using Skyhook.Landscape;

namespace Tanks.Screens
{
    class MainGameScreen : GameScreen
    {
        LandscapeComponent Landscape = null;
       
        public MainGameScreen(GameScreenManager screenmanager) : base(screenmanager)
        {
            Landscape = new LandscapeComponent();
            AddChild(Landscape);
        }

        protected override void LoadContent()
        {
        }

        protected override void Update(GameTime time)
        {
        }

        protected override void Draw(GameTime time)
        {            
        }

        protected override void OnKeyPressed(Keys key)
        {
            if (key == Keys.Left)
            {
                Landscape.Scroll(-50, 0);
            }
            if (key == Keys.Right)
            {
                Landscape.Scroll(50, 0);
            }
            if (key == Keys.Up)
            {
                Landscape.Scroll(0, -50);
            }
            if (key == Keys.Down)
            {
                Landscape.Scroll(0, 50);
            }
            if (key == Keys.Space)
            {
                TestScreen screen = new TestScreen(ScreenManager);
                screen.Show();
            }
            if (key == Keys.Escape)
            {
                Root.Exit();
            }
        }
    }
}
